import unittest

# TODO跳过测试和方法

class DemoTestCase(unittest.TestCase):
    # unittest.skip跳过测试
    @unittest.skip('跳过用例的原因')
    def test(self):
        print('test01')

    # unittest.skipIf(条件为真时,跳过装饰的测试)
    @unittest.skipIf(1 == 2, '跳过用例的原因')
    def test02(self):
        print('test02')

    # unittest.skipUnless(条件为假时,跳过装饰的测试)
    @unittest.skipUnless(1 == 2, '跳过用例的原因')
    def test03(self):
        print('test03')

    # unittest.expectedFailure(预期该测试为失败)
    @unittest.expectedFailure
    def test04(self):
        self.assertNotEqual(1, 2, '断言失败')
        print('test04')


if __name__ == '__main__':
    unittest.main(verbosity=2)